<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
    <meta name="baidu-site-verification" content="093lY4ziMu" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="我的个人博客">
    <meta name="keyword"  content="Evan, 爱问, 埃文, 博客, iOS, Developer, 软件工程师, 程序员">
    <link rel="shortcut icon" href="/img/ironman-draw.png">
    <!-- Place this tag in your head or just before your close body tag. -->
    <script async defer src="https://buttons.github.io/buttons.js"></script>
    <!--<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>-->
    <title>
        
          App多环境配置探索 - Evan | 愛問
        
    </title>

    <link rel="canonical" href="https://evanxlh.github.io/2020/04/27/app-multi-environments/">

    <!-- Bootstrap Core CSS -->
    
<link rel="stylesheet" href="/css/bootstrap.min.css">


    <!-- Custom CSS --> 
    
        
<link rel="stylesheet" href="/css/dusign-light.css">

        
<link rel="stylesheet" href="/css/dusign-common-light.css">

        
<link rel="stylesheet" href="/css/font-awesome.css">

        
<link rel="stylesheet" href="/css/toc.css">

        <!-- background effects end -->
    
    
    <!-- Pygments Highlight CSS -->
    
<link rel="stylesheet" href="/css/highlight.css">


    
<link rel="stylesheet" href="/css/widget.css">


    
<link rel="stylesheet" href="/css/rocket.css">


    
<link rel="stylesheet" href="/css/signature.css">


    
<link rel="stylesheet" href="/css/fonts.googleapis.css">


    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css">

    <!-- photography -->
    
<link rel="stylesheet" href="/css/photography.css">


    <!-- ga & ba script hoook -->
    <script></script>
<meta name="generator" content="Hexo 4.2.0"></head>


<!-- hack iOS CSS :active style -->
<body ontouchstart="">

    <!-- background effects start -->
    
    <!-- background effects end -->

	<!-- Modified by Yu-Hsuan Yen -->
<!-- Post Header -->
<style type="text/css">
    header.intro-header{
        
            
                background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('../../../../img/default-post.jpg')
                /*post*/
            
        
    }
    
</style>

<header class="intro-header" >
    <!-- Signature -->
    <div id="signature">
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                
                    <div class="post-heading">
                        <div class="tags">
                            
                              <a class="tag" href="/tags/#App构建与发布" title="App构建与发布">App构建与发布</a>
                            
                              <a class="tag" href="/tags/#App多环境配置" title="App多环境配置">App多环境配置</a>
                            
                        </div>
                        <h1>App多环境配置探索</h1>
                        <h2 class="subheading">为您解析基于Xocde的多环境配置, Development, Staging, Production.</h2>
                        <span class="meta">
                            2020-04-27, Evan | 愛問
                        </span>

                        
                            <div class="blank_box"></div>
                            <span class="meta">
                                字数: <span class="post-count">1.5k</span>, 
                                阅读时间: <span class="post-count">6</span> 
                                分钟
                            </span>
                            <div class="blank_box"></div>
                            <!-- 不蒜子统计 start -->
                            <span class="meta">
                                浏览次数: <span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span>
                            </span>
                            <!-- 不蒜子统计 end -->
                        

                    </div>
                

                </div>
            </div>
        </div>      
    </div>

    
    <div class="waveWrapper">
        <div class="wave wave_before" style="background-image: url('/img/wave-light.png')"></div>
        <div class="wave wave_after" style="background-image: url('/img/wave-light.png')"></div>
    </div>
    
</header>

	
    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <!-- <a class="navbar-brand" href="/">Evan | 愛問</a> -->
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <!-- Known Issue, found by Hux:
            <nav>'s height woule be hold on by its content.
            so, when navbar scale out, the <nav> will cover tags.
            also mask any touch event of tags, unfortunately.
        -->
        <div id="huxblog_navbar">
            <div class="navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/">主页</a>
                    </li>

                    

                        
                    

                        
                        <li>
                            <a href="/about/">关于</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/archive/">归档</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/categories/">分类</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/photography/">摄影</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/tags/">标签</a>
                        </li>
                        
                    
                    
                    
                </ul>
            </div>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
<script>
    // Drop Bootstarp low-performance Navbar
    // Use customize navbar with high-quality material design animation
    // in high-perf jank-free CSS3 implementation
    var $body   = document.body;
    var $toggle = document.querySelector('.navbar-toggle');
    var $navbar = document.querySelector('#huxblog_navbar');
    var $collapse = document.querySelector('.navbar-collapse');

    $toggle.addEventListener('click', handleMagic)
    function handleMagic(e){
        if ($navbar.className.indexOf('in') > 0) {
        // CLOSE
            $navbar.className = " ";
            // wait until animation end.
            setTimeout(function(){
                // prevent frequently toggle
                if($navbar.className.indexOf('in') < 0) {
                    $collapse.style.height = "0px"
                }
            },400)
        }else{
        // OPEN
            $collapse.style.height = "auto"
            $navbar.className += " in";
        }
    }
</script>


    <!-- Main Content -->
    <!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                post-container">

                <h1 id="App多环境配置探索"><a href="#App多环境配置探索" class="headerlink" title="App多环境配置探索"></a>App多环境配置探索</h1><h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>App开发为什么需要使用多环境呢？原因很简单，就是为了 <code>App 或 App 新功能</code> 在对所有用户开放之前能经过充分测试与验证，将问题降到最低，让用户有个好的使用体验。有了多环境，内部测试将完全与发布的产品独立开来，互不影响，这就是多环境的好处。</p>
<h3 id="环境配置"><a href="#环境配置" class="headerlink" title="环境配置"></a>环境配置</h3><p>App 的环境配置方案有很多种，这里我使用一种个人认为比较好的方式来实现， 即 <code>xcconfig</code> 与 <code>plist</code> 相结合的方式 。通常情况，我们会给 app 配置 3 个服务器，即 <code>Development</code>, <code>Staging</code>, <code>Production</code>。那 App 又如何配置，才能很方便的去连接这 3 个服务器呢？这就是我们今天想要讨论的问题。 首先，我们将 App 的运行环境分为三种：</p>
<ul>
<li><p><strong>Development</strong><br><code>Development</code> 即我们常说的开发环境，开发人员在此环境中开发与自测， 连接 <code>Development</code> 服务器。</p>
</li>
<li><p><strong>Staging</strong><br>正式产品线上环境前的预演，也就是模拟产品线上环境，连接 <code>Staging</code> 服务器。 QA在 <code>Staging</code>上对新版本做最后一轮测试, 通过后才能发布到产品线上。</p>
</li>
<li><p><strong>Production</strong><br>最终产品线上环境，连接 <code>Production</code> 服务器，App直接向所有用户开放。</p>
</li>
</ul>
<h3 id="Debug-Release"><a href="#Debug-Release" class="headerlink" title="Debug / Release"></a>Debug / Release</h3><p>iOS App 的工程配置默认包含 <code>Debug</code> 和 <code>Release</code> 两种模式，那两者有什么区别呢？</p>
<ul>
<li><p><strong>Debug</strong><br><code>Debug</code> 为调试模式，编译器不会对代码做最后的优化，包含的程序信息多，非常方便设置断点进行调试。所以这种模式下打包的 App 体积会比较大。</p>
</li>
<li><p><strong>Release</strong><br> <code>Release</code> 为发布模式，编译器最终会对代码做优化，不包含调试信息，所以打包出来的 App 体积更小，运行速度也越快，但不便于调试。</p>
</li>
</ul>
<font color=red>所以我们在`环境配置`中提到的 `Development`, `Staging`, `Production` 都会对应 `Debug` 和 `Release` 两种模式。</font>


<h2 id="配置多环境"><a href="#配置多环境" class="headerlink" title="配置多环境"></a>配置多环境</h2><p>  具体的步骤我就不写了，大家应该都知道如何去做，如果不知道如何操作，可以<a href="https://thoughtbot.com/blog/let-s-setup-your-ios-environments" target="_blank" rel="noopener">参考这里</a>，你也可以在这里<a href="https://github.com/ProgramExplore/AppEnvironment" target="_blank" rel="noopener">下载完整演示项目Github仓库</a>。</p>
<h3 id="新建-xcconfig-文件"><a href="#新建-xcconfig-文件" class="headerlink" title="新建 xcconfig 文件"></a>新建 xcconfig 文件</h3><p>首先，我们新建 3 个工程配置文件, 例如 <code>Development.xcconfig</code>,  <code>Staging.xcconfig</code>,  <code>Production.xcconfig</code>, 其中的一个配置文件内容如下：</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&#x2F;&#x2F; 因为使用了 Pods, 所以需要将 Pods 生成的配置文件包含进来. 如果不使用 Pods, 可以去去掉这一行。</span><br><span class="line">#include &quot;.&#x2F;Pods&#x2F;Target Support Files&#x2F;Pods-AppEnvironment&#x2F;Pods-AppEnvironment.release-development.xcconfig&quot;</span><br><span class="line">	</span><br><span class="line">APP_NAME &#x3D; App环境(开发)</span><br><span class="line">APP_BUNDLE_ID &#x3D; me.evanxlh.environment.development</span><br><span class="line">CONFIGRATION_PLIST_FILENAME &#x3D; Development</span><br></pre></td></tr></table></figure>
<p><img src="xcconfig-files.png" alt="xcconfig Files" /></p>
<h3 id="新建-Plist-配置文件"><a href="#新建-Plist-配置文件" class="headerlink" title="新建 Plist 配置文件"></a>新建 Plist 配置文件</h3><p>然后我们新建 3 个 Plist 配置文件，将需要加的其它配置项用 plist 文件来存储，方便解析。例如我们创建以下 3 个 文件: <code>Development.plist</code>, <code>Staging.plist</code>, <code>Production.plist</code>, 其中一个配置文件内容如下: </p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">&lt;?xml version&#x3D;&quot;1.0&quot; encoding&#x3D;&quot;UTF-8&quot;?&gt;</span><br><span class="line">&lt;!DOCTYPE plist PUBLIC &quot;-&#x2F;&#x2F;Apple&#x2F;&#x2F;DTD PLIST 1.0&#x2F;&#x2F;EN&quot; &quot;http:&#x2F;&#x2F;www.apple.com&#x2F;DTDs&#x2F;PropertyList-1.0.dtd&quot;&gt;</span><br><span class="line">&lt;plist version&#x3D;&quot;1.0&quot;&gt;</span><br><span class="line">&lt;dict&gt;</span><br><span class="line">	&lt;key&gt;serverURL&lt;&#x2F;key&gt;</span><br><span class="line">	&lt;string&gt;http:&#x2F;&#x2F;10.20.22.10&lt;&#x2F;string&gt;</span><br><span class="line">	&lt;key&gt;bugly&lt;&#x2F;key&gt;</span><br><span class="line">	&lt;dict&gt;</span><br><span class="line">		&lt;key&gt;name&lt;&#x2F;key&gt;</span><br><span class="line">		&lt;string&gt;Bugly-Development&lt;&#x2F;string&gt;</span><br><span class="line">		&lt;key&gt;appId&lt;&#x2F;key&gt;</span><br><span class="line">		&lt;string&gt;FAdfakldjfadlf8908o&lt;&#x2F;string&gt;</span><br><span class="line">		&lt;key&gt;appSecret&lt;&#x2F;key&gt;</span><br><span class="line">		&lt;string&gt;HKdfadkdfladfkdfadfa&lt;&#x2F;string&gt;</span><br><span class="line">	&lt;&#x2F;dict&gt;</span><br><span class="line">&lt;&#x2F;dict&gt;</span><br><span class="line">&lt;&#x2F;plist&gt;</span><br></pre></td></tr></table></figure>
<p><img src="configuration-plists.png" alt="Configuration Plists" /></p>
<h3 id="修改-Info-plist"><a href="#修改-Info-plist" class="headerlink" title="修改 Info.plist"></a>修改 Info.plist</h3><p>为了能在程序中从 plist 配置文件中读到配置项，我们需要在 <code>Info.plist</code> 文件中加入一个 key, 比如命名为: <code>ConfigurationPlistFileName</code>, value 设置为<code>$(CONFIGRATION_PLIST_FILENAME)</code>， <code>CONFIGRATION_PLIST_FILENAME</code>由之前新建的 <code>xcconfig</code> 文件定义。这样我们就可以在 App 中加载 plist 配置文件了。</p>
<p><img src="info-plist.png" alt="InfoPlist Modification" /></p>
<h3 id="配置工程"><a href="#配置工程" class="headerlink" title="配置工程"></a>配置工程</h3><ul>
<li>首先点击你的工程，如下图所示。然后在 <strong>Configurations</strong>下新增配置，<font color=red>记住 <code>Development</code>, <code>Staging</code>, <code>Production</code> 的 Debug 模式都要从 <strong>Debug</strong>复制出来得到，<code>Development</code>, <code>Staging</code>, <code>Production</code> 的 Release 模式都要从 <strong>Release</strong> 复制出来得到。</font></li>
</ul>
<p><img src="project-configs-overview.png" alt="Project Configs Overview.png" /></p>
<ul>
<li>给 <code>Development</code>, <code>Staging</code>, <code>Production</code> 的 <code>Debug</code> 和 <code>Release</code> 模式指定对应的 <code>xcconfig</code> 文件。<br><img src="project-config-details.png" alt="Project Config Details" /></li>
</ul>
<h3 id="Plist-配置文件解析"><a href="#Plist-配置文件解析" class="headerlink" title="Plist 配置文件解析"></a>Plist 配置文件解析</h3><figure class="highlight swift"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> HandyJSON</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">struct</span> <span class="title">AppConfiguration</span> </span>&#123;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">fileprivate</span> <span class="keyword">static</span> <span class="keyword">let</span> shared = <span class="type">AppConfiguration</span>()</span><br><span class="line">    </span><br><span class="line">    <span class="comment">/// The `key` in the `Info.plist` which tells the filename of the configuration plist file.</span></span><br><span class="line">    <span class="keyword">fileprivate</span> <span class="keyword">let</span> keyInInfoPlist = <span class="string">"ConfigurationPlistFileName"</span></span><br><span class="line">    </span><br><span class="line">    <span class="keyword">fileprivate</span> <span class="keyword">var</span> values: <span class="type">Values!</span></span><br><span class="line">    <span class="keyword">fileprivate</span> <span class="keyword">var</span> configurationType: <span class="type">ConfigurationType!</span></span><br><span class="line">    </span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">init</span>() &#123;</span><br><span class="line">        <span class="keyword">let</span> configInfo = loadConfigurationValues()</span><br><span class="line">        <span class="keyword">self</span>.values = configInfo.<span class="number">0</span></span><br><span class="line">        <span class="keyword">self</span>.configurationType = configInfo.<span class="number">1</span></span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">fileprivate</span> <span class="function"><span class="keyword">func</span> <span class="title">loadConfigurationValues</span><span class="params">()</span></span> -&gt; (<span class="type">Values</span>, <span class="type">ConfigurationType</span>) &#123;</span><br><span class="line">        <span class="keyword">guard</span> <span class="keyword">let</span> filename = <span class="type">Bundle</span>.main.infoDictionary?[keyInInfoPlist] <span class="keyword">as</span>? <span class="type">String</span> <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="built_in">fatalError</span>(<span class="string">"Please specify configuration plist filename in Info.plist"</span>)</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">guard</span> <span class="keyword">let</span> type = <span class="type">ConfigurationType</span>(rawValue: filename) <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="built_in">fatalError</span>(<span class="string">"Not supported configuration name"</span>)</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">guard</span> <span class="keyword">let</span> url = <span class="type">Bundle</span>.main.url(forResource: filename, withExtension: <span class="string">"plist"</span>) <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="built_in">fatalError</span>(<span class="string">"Configuration plist file not found"</span>)</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">guard</span> <span class="keyword">let</span> dic = <span class="type">NSDictionary</span>(contentsOf: url) <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="built_in">fatalError</span>(<span class="string">"The format of configuration plist file is invalid"</span>)</span><br><span class="line">        &#125;</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">guard</span> <span class="keyword">let</span> values = <span class="type">Values</span>.deserialize(from: dic) <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="built_in">fatalError</span>(<span class="string">"The format of configuration plist file is invalid"</span>)</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> (values, type)</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// MARK: - Public APIs</span></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">extension</span> <span class="title">AppConfiguration</span> </span>&#123;</span><br><span class="line">    </span><br><span class="line">    <span class="class"><span class="keyword">enum</span> <span class="title">ConfigurationType</span>: <span class="title">String</span> </span>&#123;</span><br><span class="line">        <span class="keyword">case</span> development = <span class="string">"Development"</span></span><br><span class="line">        <span class="keyword">case</span> staging = <span class="string">"Staging"</span></span><br><span class="line">        <span class="keyword">case</span> production = <span class="string">"Production"</span></span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="class"><span class="keyword">struct</span> <span class="title">OpenPlatform</span>: <span class="title">HandyJSON</span> </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> name: <span class="type">String</span> = <span class="string">""</span></span><br><span class="line">        <span class="keyword">var</span> appId: <span class="type">String</span> = <span class="string">""</span></span><br><span class="line">        <span class="keyword">var</span> appSecret: <span class="type">String</span> = <span class="string">""</span></span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="comment">/// All the configuration values</span></span><br><span class="line">    <span class="class"><span class="keyword">struct</span> <span class="title">Values</span>: <span class="title">HandyJSON</span> </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> serverURL: <span class="type">String</span> = <span class="string">""</span></span><br><span class="line">        <span class="keyword">var</span> bugly: <span class="type">OpenPlatform</span> = <span class="type">OpenPlatform</span>()</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="comment">/// Type of app configuration which is applied.</span></span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">var</span> type: <span class="type">ConfigurationType</span> &#123;</span><br><span class="line">        <span class="keyword">return</span> shared.configurationType</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="comment">/// Accessing all the configuration items by this property.</span></span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">var</span> values: <span class="type">Values</span> &#123;</span><br><span class="line">        <span class="keyword">return</span> shared.values</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>最后我们就可以直接用 <code>AppConfiguration.values</code> 获取所有的配置项了。</p>
<h3 id="Scheme-创建"><a href="#Scheme-创建" class="headerlink" title="Scheme 创建"></a>Scheme 创建</h3><p>首先分为为 <code>Development</code>, <code>Staging</code>, <code>Production</code> 环境配置 创建 Scheme：  </p>
<p><img src="schemes.png" alt="Three Schemes" /></p>
<p>然后为每一个 Scheme 进行配置：  </p>
<p><img src="scheme-config.png" alt="Scheme Config" /></p>
<h3 id="使用-Pods-注意事项"><a href="#使用-Pods-注意事项" class="headerlink" title="使用 Pods 注意事项"></a>使用 Pods 注意事项</h3><p>因为我们自己给工程添加了 <code>xcconfig</code> 文件，所以 <code>pod install</code> 时不会再去设置工程的配置文件。这时需要我们在自己创建的 <code>xcconfig</code> 文件中将 Pod 的 <code>xcconfig</code> 文件引用进来，然后执行以下操作：  </p>
<font color=red>
1. 删除 `Pods`、`Podfile.lock`、`xcworkspace`文件  
2. 重新执行 `pod install`   
</font>

<h2 id="结束语"><a href="#结束语" class="headerlink" title="结束语"></a>结束语</h2><p>好了，配置完成。</p>
<p>如果一些操作不熟悉，你也可以参考这篇文章：<br><a href="https://thoughtbot.com/blog/let-s-setup-your-ios-environments" target="_blank" rel="noopener">https://thoughtbot.com/blog/let-s-setup-your-ios-environments</a></p>

                
                <hr>
                <!-- Pager -->
                <ul class="pager">
                    
                    <li class="previous">
                        <a href="/2020/05/28/ios-app-resigning/" data-toggle="tooltip" data-placement="top" title="iOS app 重签名及发布至 AppStore">&larr; 上一篇</a>
                    </li>
                    
                    
                </ul>

                <!-- tip start -->
                

                
                <!-- tip end -->

                <!-- Music start-->
                
                
<link rel="stylesheet" href="/css/music-player/fonts/iconfont.css">


<link rel="stylesheet" href="/css/music-player/css/reset.css">


<link rel="stylesheet" href="/css/music-player/css/player.css">


<div class="music-player">
    <audio class="music-player__audio" ></audio>
    <div class="music-player__main">
        <div class="music-player__blur"></div>
        <div class="music-player__disc">
            <div class="music-player__image">
                <img width="100%" src="" alt="">
            </div>
            <div class="music-player__pointer"><img width="100%" src="/img/cd_tou.png" alt=""></div>
        </div>
        <div class="music-player__controls">
            <div class="music__info">
                <h3 class="music__info--title">...</h3>
                <p class="music__info--singer">...</p>
            </div>
            <div class="player-control">
                <div class="player-control__content">
                    <div class="player-control__btns">
                        <div class="player-control__btn player-control__btn--prev"><i class="iconfont icon-prev"></i></div>
                        <div class="player-control__btn player-control__btn--play"><i class="iconfont icon-play"></i></div>
                        <div class="player-control__btn player-control__btn--next"><i class="iconfont icon-next"></i></div>
                        <div class="player-control__btn player-control__btn--mode"><i class="iconfont icon-loop"></i></div>
                    </div>
                    <div class="player-control__volume">
                        <div class="control__volume--icon player-control__btn"><i class="iconfont icon-volume"></i></div>
                        <div class="control__volume--progress player_progress"></div>
                    </div>
                </div>
                <div class="player-control__content">
                    <div class="player__song--progress player_progress"></div>
                    <div class="player__song--timeProgess nowTime">00:00</div>
                    <div class="player__song--timeProgess totalTime">00:00</div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="/js/music-player/utill.js"></script>


<script src="/js/music-player/jquery.min.js"></script>


<script src="/js/music-player/player.js"></script>


                
                <!-- Music end -->

                <!-- Sharing -->
                
                <div class="social-share"  data-wechat-qrcode-helper="" align="center"></div>
                <!--  css & js -->
                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css">
                <script src="https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js"></script>
                
                <!-- Sharing -->

                <!-- gitment start -->
                
                <!-- gitment end -->

                <!-- 来必力City版安装代码 -->
                
                <!-- City版安装代码已完成 -->

                <!-- disqus comment start -->
                
                <!-- disqus comment end -->
            </div>
            
            <!-- Tabe of Content -->
            <!-- Table of Contents -->

    
      
        <aside id="sidebar">
          <div id="toc" class="toc-article">
          <strong class="toc-title">Contents</strong>
          
            
              <ol class="toc-nav"><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#App多环境配置探索"><span class="toc-nav-text">App多环境配置探索</span></a><ol class="toc-nav-child"><li class="toc-nav-item toc-nav-level-2"><a class="toc-nav-link" href="#简介"><span class="toc-nav-text">简介</span></a><ol class="toc-nav-child"><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#环境配置"><span class="toc-nav-text">环境配置</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#Debug-Release"><span class="toc-nav-text">Debug &#x2F; Release</span></a></li></ol></li><li class="toc-nav-item toc-nav-level-2"><a class="toc-nav-link" href="#配置多环境"><span class="toc-nav-text">配置多环境</span></a><ol class="toc-nav-child"><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#新建-xcconfig-文件"><span class="toc-nav-text">新建 xcconfig 文件</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#新建-Plist-配置文件"><span class="toc-nav-text">新建 Plist 配置文件</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#修改-Info-plist"><span class="toc-nav-text">修改 Info.plist</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#配置工程"><span class="toc-nav-text">配置工程</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#Plist-配置文件解析"><span class="toc-nav-text">Plist 配置文件解析</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#Scheme-创建"><span class="toc-nav-text">Scheme 创建</span></a></li><li class="toc-nav-item toc-nav-level-3"><a class="toc-nav-link" href="#使用-Pods-注意事项"><span class="toc-nav-text">使用 Pods 注意事项</span></a></li></ol></li><li class="toc-nav-item toc-nav-level-2"><a class="toc-nav-link" href="#结束语"><span class="toc-nav-text">结束语</span></a></li></ol></li></ol>
            
          
          </div>
        </aside>
      
    

                
            <!-- Sidebar Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                sidebar-container">

                <!-- Featured Tags -->
                
                <section>
                    <!-- no hr -->
                    <h5><a href="/tags/">特色标签</a></h5>
                    <div class="tags">
                       
                          <a class="tag" href="/tags/#App构建与发布" title="App构建与发布">App构建与发布</a>
                        
                          <a class="tag" href="/tags/#App多环境配置" title="App多环境配置">App多环境配置</a>
                        
                    </div>
                </section>
                

                <!-- Friends Blog -->
                
                <hr>
                <h5>友情链接</h5>
                <ul class="list-inline">

                    
                        <li><a href="https://github.com/evanxlh" target="_blank">我的Github</a></li>
                    
                        <li><a href="https://gitee.com/evanxlh" target="_blank">我的Gitee</a></li>
                    
                </ul>
                
            </div>
        </div>
    </div>
</article>




<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>
<!-- anchor-js, Doc:http://bryanbraun.github.io/anchorjs/ -->
<script>
    async("https://cdn.bootcss.com/anchor-js/1.1.1/anchor.min.js",function(){
        anchors.options = {
          visible: 'hover',
          placement: 'left',
          icon: 'ℬ'
        };
        anchors.add().remove('.intro-header h1').remove('.subheading').remove('.sidebar-container h5');
    })
</script>


<style  type="text/css">
    /* place left on bigger screen */
    @media all and (min-width: 800px) {
        .anchorjs-link{
            position: absolute;
            left: -0.75em;
            font-size: 1.1em;
            margin-top : -0.1em;
        }
    }
</style>



    <!-- Footer -->
    <!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">

                
                    <li>
                        <a target="_blank"  href="https://github.com/evanxlh">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                

                

                

                

                

                

                </ul>
                <p class="copyright text-muted">
                    Copyright &copy; Evan | 愛問 2020 
                    <br>
                    Powered by 
                    <a href="https://github.com/dusign/hexo-theme-snail" target="_blank" rel="noopener">
                        <i>hexo-theme-snail</i>
                    </a> | 
                    <iframe name="star" style="margin-left: 2px; margin-bottom:-5px;" frameborder="0" scrolling="0"
                        width="100px" height="20px"
                        src="https://ghbtns.com/github-btn.html?user=dusign&repo=hexo-theme-snail&type=star&count=true">
                    </iframe>
                </p>
            </div>
        </div>
    </div>

</footer>

<!-- jQuery -->

<script src="/js/jquery.min.js"></script>


<!-- Bootstrap Core JavaScript -->

<script src="/js/bootstrap.min.js"></script>


<!-- Custom Theme JavaScript -->

<script src="/js/hux-blog.min.js"></script>


<!-- Search -->

<script src="/js/search.js"></script>


<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>


<!-- jquery.tagcloud.js -->
<script>
    // only load tagcloud.js in tag.html
    if($('#tag_cloud').length !== 0){
        async("https://evanxlh.github.io/js/jquery.tagcloud.js",function(){
            $.fn.tagcloud.defaults = {
                //size: {start: 1, end: 1, unit: 'em'},
                color: {start: '#bbbbee', end: '#0085a1'},
            };
            $('#tag_cloud a').tagcloud();
        })
    }
</script>

<!--fastClick.js -->
<script>
    async("https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js", function(){
        var $nav = document.querySelector("nav");
        if($nav) FastClick.attach($nav);
    })
</script>


<!-- Google Analytics -->




<!-- Baidu Tongji -->


<!-- Search -->

    <script type="text/javascript">      
        var search_path = "search.xml";
        if (search_path.length == 0) {
            search_path = "search.xml";
        }
    var path = "/" + search_path;
    searchFunc(path, 'local-search-input', 'local-search-result');
    </script>


<!-- busuanzi -->
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>






	<a id="rocket" href="#top" class=""></a>
	<script type="text/javascript" src="/js/totop.js?v=1.0.0" async=""></script>
    <script type="text/javascript" src="/js/toc.js?v=1.0.0" async=""></script>

    
        <!-- background effects line -->
        

        
            <script type="text/javascript" src="/js/mouse-click.js" content='[&quot;🌱&quot;,&quot;🍀&quot;, &quot;🍎&quot;,&quot;❤️&quot;,&quot;💖&quot;,&quot;💞&quot;,🍷&quot;,&quot;🌷&quot;,&quot;🦋&quot;]' color='[&quot;rgb(121,93,179)&quot; ,&quot;rgb(76,180,231)&quot; ,&quot;rgb(184,90,154)&quot;]'></script>
        

        <!-- background effects end -->
    

    <!--<script size="50" alpha='0.3' zIndex="-999" src="/js/ribbonStatic.js"></script>-->
    
        <script src="/js/ribbonDynamic.js"></script>
    
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [ ["$","$"], ["\\(","\\)"] ],
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
            processEscapes: true
        }
    });
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax();
        for (var i = 0; i < all.length; ++i)
            all[i].SourceElement().parentNode.className += ' has-jax';
    });
</script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</body>

</html>
